﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Agro.Library;
using SN.Core;
using Agro.Models;
using Ninject;
using Agro.Services;
using SN.Data;
using System.Data;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Agro.Web.Areas.SystemManage.Controllers
{
    public class SbrqController : BaseController
    {
        //
        // GET: /SystemManage/Sbrq/
        [Inject]
        public ISbrqService SbrqService { get; set; }


        public ActionResult Index()
        {
            return View();
        }

        public ActionResult SbrqList()
        {
            return View();
        }

        public ActionResult GetSbrqList(QueryBase query)
        {
            WhereClip where = WhereClip.All;
            var list = SbrqService.GetEntityList<T_DeadlineConfig>(where, query);
            return JqGrid(list, query);
        }

        [HttpPost]
        public ActionResult Save()
        {
            string Msg = string.Empty;
            string sComment = Convert.ToString(Request["Comment"]);
            string sValue = Convert.ToString(Request["Value"]);
            string sFormatDay = Convert.ToString(Request["FormatDay"]);
            Msg = SbrqService.SbrqSave(sComment, sValue, sFormatDay);
            return Json(Msg);
        }

    }
}
